class ExaminationTypesController < ApplicationController
  # GET /examination_types
  # GET /examination_types.xml
  def index
    @examination_types = ExaminationType.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @examination_types }
    end
  end

  # GET /examination_types/1
  # GET /examination_types/1.xml
  def show
    @examination_type = ExaminationType.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @examination_type }
    end
  end

  # GET /examination_types/new
  # GET /examination_types/new.xml
  def new
    @examination_type = ExaminationType.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @examination_type }
    end
  end

  # GET /examination_types/1/edit
  def edit
    @examination_type = ExaminationType.find(params[:id])
  end

  # POST /examination_types
  # POST /examination_types.xml
  def create
    @examination_type = ExaminationType.new(params[:examination_type])

    respond_to do |format|
      if @examination_type.save
        flash[:notice] = 'ExaminationType was successfully created.'
        format.html { redirect_to(@examination_type) }
        format.xml  { render :xml => @examination_type, :status => :created, :location => @examination_type }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @examination_type.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /examination_types/1
  # PUT /examination_types/1.xml
  def update
    @examination_type = ExaminationType.find(params[:id])

    respond_to do |format|
      if @examination_type.update_attributes(params[:examination_type])
        flash[:notice] = 'ExaminationType was successfully updated.'
        format.html { redirect_to(@examination_type) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @examination_type.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /examination_types/1
  # DELETE /examination_types/1.xml
  def destroy
    @examination_type = ExaminationType.find(params[:id])
    @examination_type.destroy

    respond_to do |format|
      format.html { redirect_to(examination_types_url) }
      format.xml  { head :ok }
    end
  end
end
